import { anyPermission, allPermission } from '@/utils/permission'


export const allPermissionDirective = {
    mounted(el, binding) {
        if (!allPermission(binding.value)) {
            el.parentNode.removeChild(el)
        }
    },
    update(el, binding) {
        if (!allPermission(binding.value)) {
            el.parentNode.removeChild(el)
        }
    }
}
export const anyPermissionDirective = {

    mounted(el, binding) {
        if (!anyPermission(binding.value)) {
            el.parentNode.removeChild(el)
        }
    },
    update(el, binding) {
        if (!anyPermission(binding.value)) {
            el.parentNode.removeChild(el)
        }
    }
}